<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>查看设备详情</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$('#videovolume').slider({
			formatter: function(value) {
				return value;
			}
		});
			$('#audiovolume').slider({
				formatter: function(value) {
					return value;
				}
			});
			$('#backlight').slider({
				formatter: function(value) {
					return value;
				}
			});
			$('#sleeplightlevel1').slider({
				formatter: function(value) {
					return value;
				}
			});
			$('#sleeplightlevel2').slider({
				formatter: function(value) {
					return value;
				}
			});
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('<spring:message code="common.subbmiting"/>');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		
	</script>
    <style>
        .input-mini{
            width: 60px;
        }
        .select2-container{
            width: 120px;
        }
        .form-horizontal .control-group {
            margin-bottom: 8px;
            display: block;
            height: 35px;
            line-height: 35px;
            width: 100%;
            float: left;
        }
        .form-horizontal .control-label{
            padding-top: 10px;
        }
         #videovolumeSlider {
         			margin-left: 10px;
         }
                  #audiovolumeSlider {
         			margin-left: 10px;
         }
                  #backlightSlider {
         			margin-left: 10px;
         }
                  #sleeplightlevel1Slider {
         			margin-left: 10px;
         }
                  #sleeplightlevel2Slider {
         			margin-left: 10px;
         }
        #videovolumeSlider .slider-selection {
			background: #BABABA;
		}
		#audiovolumeSlider .slider-selection {
			background: #BABABA;

		}
		#backlightSlider .slider-selection {
			background: #BABABA;

		}
		#sleeplightlevel1Slider .slider-selection {
			background: #BABABA;

		}
		#sleeplightlevel2Slider .slider-selection {
			background: #BABABA;

		}
    </style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="javascript:void(0);">设备监控</a></li>
	</ul>
	<form:form id="inputForm" modelAttribute="eleEquipment" action="${ctx}/equipment/eleEquipment/config" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>

        <%--<div class="form-actions" style="    padding-left: 80px;background-color: inherit;    border: 0;">
            <a href="${ctx}/equipment/eleEquipment/floor_mapping?id=${eleEquipment.id}" class="btn ">楼层映射</a>
        </div>--%>
		<div class="control-group">
			<label class="control-label">视频音量：</label>
			<div class="controls">
				<c:if test="${not empty eleEquipment.videovolume}">
					<input id="videovolume" name="videovolume" data-slider-id='videovolumeSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="${eleEquipment.videovolume}"/>
				</c:if>
				<c:if test="${empty eleEquipment.videovolume}">
					<input id="videovolume" name="videovolume" data-slider-id='videovolumeSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="50"/>
				</c:if>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">报站音量：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.audiovolume}">
				<input id="audiovolume" name="audiovolume" data-slider-id='audiovolumeSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="${eleEquipment.audiovolume}"/>
			</c:if>
			<c:if test="${empty eleEquipment.audiovolume}">
				<input id="audiovolume" name="audiovolume" data-slider-id='audiovolumeSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="80"/>
			</c:if>
			</div>
		</div>
		<%--<div class="control-group">
			<label class="control-label">Ip类型：</label>
			<div class="controls">
                <form:select path="ipmode" >
                    <form:options items="${fns:getDictList('ipmode')}" itemLabel="label" itemValue="value" htmlEscape="false" class="input-small" />
                </form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">Ip地址：</label>
			<div class="controls">
				<form:input path="ipaddress" htmlEscape="false" maxlength="50" class="required input-small"/>
			</div>
		</div>--%>
		<%--<div class="control-group">
			<label class="control-label">服务器地址：</label>
			<div class="controls">
				<form:input path="serverIpaddress" htmlEscape="false" maxlength="50" class="required input-mini"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">服务器端口：</label>
			<div class="controls">
				<form:input path="serverPort" htmlEscape="false" maxlength="50" class="required input-mini"/>
			</div>
		</div>--%>
		<div class="control-group">
			<label class="control-label">背光亮度：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.backlight}">
				<input id="backlight" name="backlight" data-slider-id='backlightSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="${eleEquipment.backlight}"/>
			</c:if>
			<c:if test="${empty eleEquipment.backlight}">
				<input id="backlight" name="backlight" data-slider-id='backlightSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="80"/>
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">1休眠亮度：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.sleeplightlevel1}">
				<input id="sleeplightlevel1" name="sleeplightlevel1" data-slider-id='sleeplightlevel1Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="${eleEquipment.sleeplightlevel1}"/>
			</c:if>
			<c:if test="${empty eleEquipment.sleeplightlevel1}">
				<input id="sleeplightlevel1" name="sleeplightlevel1" data-slider-id='sleeplightlevel1Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="15"/>
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">1休眠时间：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.hangupthreshold1}">
				<form:input path="hangupthreshold1" htmlEscape="false" maxlength="50" class="required input-mini digits" value="${eleEquipment.hangupthreshold1}"/>秒
			</c:if>
			<c:if test="${empty eleEquipment.hangupthreshold1}">
				<form:input path="hangupthreshold1" htmlEscape="false" maxlength="50" class="required input-mini digits" value="90"/>秒
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">2休眠亮度：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.sleeplightlevel2}">
				<input id="sleeplightlevel2" name="sleeplightlevel2" data-slider-id='sleeplightlevel2Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="${eleEquipment.sleeplightlevel2}"/>
			</c:if>
			<c:if test="${empty eleEquipment.sleeplightlevel2}">
				<input id="sleeplightlevel2" name="sleeplightlevel2" data-slider-id='sleeplightlevel2Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0"/>
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">2休眠时间：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.hangupthreshold2}">
				<form:input path="hangupthreshold2" htmlEscape="false" maxlength="50" class="required input-mini digits" value="${eleEquipment.hangupthreshold2}"/>秒
			</c:if>
			<c:if test="${empty eleEquipment.hangupthreshold2}">
				<form:input path="hangupthreshold2" htmlEscape="false" maxlength="50" class="required input-mini digits" value="1200"/>秒
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">载人：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.personlimit}">
				<form:input path="personlimit" htmlEscape="false" maxlength="50" class="required input-mini digits" value="${eleEquipment.personlimit}"/>
			</c:if>
			<c:if test="${empty eleEquipment.personlimit}">
				<form:input path="personlimit" htmlEscape="false" maxlength="50" class="required input-mini digits" value="13"/>
			
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">载重：</label>
			<div class="controls">
			<c:if test="${not empty eleEquipment.kglimit}">
				<form:input path="kglimit" htmlEscape="false" maxlength="50" class="required input-mini digits" value="${eleEquipment.kglimit}"/>KG
			</c:if>
			<c:if test="${empty eleEquipment.kglimit}">
				<form:input path="kglimit" htmlEscape="false" maxlength="50" class="required input-mini digits" value="1050"/>KG
			</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">时区：</label>
			<div class="controls">
				<form:select path="timezone" >
					<form:options items="${fns:getDictList('timezone')}" itemLabel="label" itemValue="value" htmlEscape="false" class="input-small"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">语言：</label>
			<div class="controls">
				<form:select path="language" >
					<form:options items="${fns:getDictList('language')}" itemLabel="label" itemValue="value" htmlEscape="false" class="input-small"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">屏幕方向：</label>
			<div class="controls">
                <label class="lbl">${fns:getDictLabel(eleEquipment.orientation, "orientation" ,"竖屏")}</label>
			</div>
		</div>
		<%--<div class="control-group">
			<label class="control-label">WIFI热点名称：</label>
			<div class="controls">
				<form:input path="wifiName" htmlEscape="false" maxlength="50" class="required input-small"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">WIFI连接密码：</label>
			<div class="controls">
				<form:input path="wifiPassword" htmlEscape="false" maxlength="50" class="required input-small"/>
			</div>
		</div>--%>

		<div class="control-group" style="display: none;">
			<label class="control-label">是否全屏：</label>
			<div class="controls">
				<form:radiobuttons path="fullscreen" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</div>
		</div>
		<div class="control-group" style="display: none;">
			<label class="control-label">标题显隐：</label>
			<div class="controls">
				<form:radiobuttons path="titledisplay" items="${fns:getDictList('display')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</div>
		</div>
		<div class="control-group" style="display: none;">
			<label class="control-label">时间、日期显隐：</label>
			<div class="controls">
				<form:radiobuttons path="timedisplay" items="${fns:getDictList('display')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</div>
		</div>
		<div class="control-group" style="display: none;">
			<label class="control-label">滚动文字显隐：</label>
			<div class="controls">
				<form:radiobuttons path="subtitledisplay" items="${fns:getDictList('display')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</div>
		</div>
		<div class="control-group" style="display: none;">
			<label class="control-label">图片间隔：</label>
			<div class="controls">
                <form:input path="imageinterval" htmlEscape="false" maxlength="50" class="required input-mini digits"/>秒
			</div>
		</div>
		
		<div class="control-group" >
			<label class="control-label">日期格式：</label>
			<div class="controls">
				<form:select path="dateformat" >
					<form:options items="${fns:getDictList('dateFormat')}" itemLabel="label" itemValue="value" htmlEscape="false" class="input-small"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">时间格式：</label>
			<div class="controls">
				<form:radiobuttons path="timeformat" items="${fns:getDictList('timeFormat')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label"><spring:message code='common.resolution'/>：</label>
			<div class="controls">
				<label class="lbl">${eleEquipment.width} X ${eleEquipment.height}</label>
			</div>
		</div>

        <div class="control-group" style="width:100%;">
            <shiro:hasPermission name="equipment:eleEquipment:edit">
                <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" style="margin-left: 100px;"/>&nbsp;
            </shiro:hasPermission>
        </div>
	</form:form>
</body>
</html>